package org.test.javaCharacteristic.inherit2;

import junit.framework.Assert;

import org.junit.Test;

public class ParentClass {
	public int i = 10;

	public String p = "parent";

	public String tosay() {

		return "parent";
	}

	/**
	 * @return the i
	 */
	public int getI() {
		return i;
	}

	/**
	 * @param i
	 *            the i to set
	 */
	public void setI(int i) {
		this.i = i;
	}

	/**
	 * @return the p
	 */
	public String getP() {
		return p;
	}

	/**
	 * @param p
	 *            the p to set
	 */
	public void setP(String p) {
		this.p = p;
	}

}

/**
 * 子类的全部属性方法都重写父类的
 * @author Administrator
 *
 */
class SubClass extends ParentClass {
	public int i = 30;

	public String p = "child";

	public String tosay() {

		return "child";
	}

	/**
	 * @return the i
	 */
	public int getI() {
		return i;
	}

	/**
	 * @param i the i to set
	 */
	public void setI(int i) {
		this.i = i;
	}

	/**
	 * @return the p
	 */
	public String getP() {
		return p;
	}

	/**
	 * @param p the p to set
	 */
	public void setP(String p) {
		this.p = p;
	}
	
	
}
